package com.codecrane.core.util;

/**
 * 获取币种
 */
public enum CountryMoneyTypeEnum {
    US(1, "美金"),
    UK(2, "英镑"),
    DE(3, "欧元"),
    FR(4, "欧元"),
    IT(5, "欧元"),
    ES(6, "欧元"),
    EU(7, "欧元"),
    JP(8, "日元"),
    CA(9, "加元"),

    CN(10, "人民币"),
    PKUS(13,"美金"),
    PKUK(14,"英镑"),
    PKDE(15,"欧元");

    private int code;
    private String msg;

    CountryMoneyTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getCountry(int code) {
        for (CountryMoneyTypeEnum countryEnum : CountryMoneyTypeEnum.values()) {
            if (code == countryEnum.getCode()) {
                return countryEnum.getMsg();
            }
        }
        return "";
    }
}
